<?php
function  get_data_interface($query){
	$news_req = db_execute("SELECT * FROM news WHERE news_id='$news_id'",dbconnect());
	return db_fetch_assoc($news_req);
}
/*
 * Update user into table plugin_nms_log
 * */
function update_log($interface_id){
	$sql = 'SELECT log_id  FROM plugin_nms_log where interface_id ="'.$interface_id.'"order by log_id DESC  limit 0,1';
	$result =db_fetch_cell($sql);
	$sql1 = 'SELECT user_active  FROM plugin_nms_log where interface_id ="'.$interface_id.'"order by log_id DESC  limit 0,1';
	$result1 = db_fetch_cell($sql1);
	$user= db_fetch_cell("select username from user_auth where id=" . $_SESSION["sess_user_id"]);
	if($result1 == null){
		$sql2=' Update plugin_nms_log
							Set user_active = "'.$user.'"
							Where log_id = "'.$result.'"';
		db_execute($sql2);
	}
}
/*
 * Update nms_pause = 0 into table plugin_nms_interface
 * */
function update_action_pause($id){
	db_execute("UPDATE plugin_nms_interface SET nms_pause=0 WHERE interface_id IN ($id)");
}
/*
 * Update nms_pause = 1 into table plugin_nms_interface
* */
function update_action_resume($id){
	db_execute("UPDATE plugin_nms_interface SET nms_pause=1 WHERE interface_id IN ($id)");
}
function update_action_pause1($id){
	db_execute('UPDATE plugin_nms_interface SET nms_pause=0 WHERE interface_id ='.$id.'');
}
/*
 * Update issound =0 into table plugin_nms_interface
* */
function update_isound($interface_id){
	db_execute('UPDATE plugin_nms_interface SET issound=0 where interface_id ="'.$interface_id.'"');
}
function update_alias_interface($alias,$interface_id){
	db_execute('UPDATE plugin_nms_interface
				SET interface_alias = "'.$alias.'"
				WHERE interface_id = '.$interface_id.'');
}
function update_field_value_host_snmp_cache($field_value,$host_id,$oid){
		db_execute('UPDATE host_snmp_cache
				SET field_value = "'.$field_value.'"
				WHERE host_id = '.$host_id.'
					AND oid = "'.$oid.'"');
}
function update_sound_device($id){
	db_execute('UPDATE host SET warning =0 WHERE id = '.$id.'');
}

?>